<?php

/**
 * pagecomment form base class.
 *
 * @method pagecomment getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasepagecommentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ID'              => new sfWidgetFormInputHidden(),
      'ClassName'       => new sfWidgetFormChoice(array('choices' => array('PageComment' => 'PageComment'))),
      'Created'         => new sfWidgetFormDateTime(),
      'LastEdited'      => new sfWidgetFormDateTime(),
      'Name'            => new sfWidgetFormInputText(),
      'Comment'         => new sfWidgetFormTextarea(),
      'IsSpam'          => new sfWidgetFormInputText(),
      'NeedsModeration' => new sfWidgetFormInputText(),
      'CommenterURL'    => new sfWidgetFormInputText(),
      'SessionID'       => new sfWidgetFormInputText(),
      'ParentID'        => new sfWidgetFormInputText(),
      'AuthorID'        => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ID'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ID')), 'empty_value' => $this->getObject()->get('ID'), 'required' => false)),
      'ClassName'       => new sfValidatorChoice(array('choices' => array(0 => 'PageComment'), 'required' => false)),
      'Created'         => new sfValidatorDateTime(array('required' => false)),
      'LastEdited'      => new sfValidatorDateTime(array('required' => false)),
      'Name'            => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'Comment'         => new sfValidatorString(array('required' => false)),
      'IsSpam'          => new sfValidatorInteger(array('required' => false)),
      'NeedsModeration' => new sfValidatorInteger(array('required' => false)),
      'CommenterURL'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'SessionID'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'ParentID'        => new sfValidatorInteger(array('required' => false)),
      'AuthorID'        => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('pagecomment[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'pagecomment';
  }

}
